Skip to content

Conversation

@mikesposito
Copy link
Member

@mikesposito mikesposito commented Sep 29, 2025

Explanation

This PR migrates all remaining assets controllers to @metamask/messenger instead of @metamask/base-controller. This is part of a larger effort to migrate all controllers to use @metamask/messenger.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Migrates remaining assets controllers and tests from base-controller messenger to @metamask/messenger, updating metadata APIs and messaging calls.

  • Assets Controllers migration
    • Switch MultichainAssetsController, MultichainBalancesController, NftDetectionController, RatesController, and TokenSearchDiscoveryDataController (and related types) to @metamask/messenger.
    • Replace RestrictedMessenger with Messenger; update calls from messagingSystem.* to messenger.* (publish, subscribe, call).
    • Move imports to @metamask/base-controller/next; adopt StateMetadata and includeInDebugSnapshot in controller metadata.
    • Adjust event/action types (e.g., MessengerActions, MessengerEvents), and messenger construction (root/delegated namespaces) in tests.
  • RatesController
    • Update metadata to use includeInDebugSnapshot; keep polling events (pollingStarted/pollingStopped) publishing via new messenger.
  • Tests
    • Refactor tests to use namespaced root messengers and delegate APIs; update deriveStateFromMetadata calls to includeInDebugSnapshot.
  • Changelog
    • Consolidate BREAKING note: controllers migrated to new Messenger (adds PR references).
  • Misc
    • Update ESLint warning thresholds.

Written by Cursor Bugbot for commit 65a9c08. This will update automatically on new commits. Configure here.

@mikesposito mikesposito mentioned this pull request Sep 29, 2025
43 tasks
@mikesposito mikesposito force-pushed the mikesposito/messenger/assets-controllers branch from 6a27d5a to 6e80728 Compare September 29, 2025 09:31
@mikesposito mikesposito marked this pull request as ready for review September 29, 2025 09:35
@mikesposito mikesposito requested review from a team as code owners September 29, 2025 09:35
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that Cursor noticed.

AllEvents,
RootMessenger
>({
namespace: controllerName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it does seem that we need a parent option here.

@mikesposito mikesposito requested review from a team as code owners October 20, 2025 09:44
@mikesposito mikesposito requested review from a team as code owners October 20, 2025 09:44
@socket-security
Copy link

socket-security bot commented Oct 20, 2025

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

mikesposito and others added 15 commits October 20, 2025 11:54
…ntrollers' into mikesposito/messenger/assets-controllers

* origin/mikesposito/messenger/polling-controllers:
  Update ESLint warning threshold
  Fix changelog mistakes from recent merges
  Update changelogs following branch update
  Update messagingSystem references to messenger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants